{*
SPDX-FileCopyrightText: © 2021 Olivier Meunier <olivier@neokraft.net>

SPDX-License-Identifier: AGPL-3.0-only
*}
{{ extends "./base" }}
{{ import "/_libs/forms" }}

{{ block title() }}Profile{{ end }}

{{ block mainContent() }}
<h1 class="title text-h2">Your profile</h1>

<form action="{{ urlFor() }}" method="post">
  {{ yield formErrors(form=.Form) }}
  {{ yield csrfField() }}

  {{ yield textField(
    field=.Form.Get("username"),
    required=true,
    label="Username",
    class="field-h",
  ) }}

  {{ yield textField(
    field=.Form.Get("email"),
    type="email",
    required=true,
    label="Email",
    class="field-h",
  ) }}

  <p><button class="btn-primary" type="submit">Save</button></p>
</form>
{{ end }}
